feat(agent-memory): add access_strategy and tenant params for multitenancy#222
Draft
cassiofariasmachado wants to merge 7 commits into
Draft
feat(agent-memory): add access_strategy and tenant params for multitenancy#222cassiofariasmachado wants to merge 7 commits into
cassiofariasmachado wants to merge 7 commits into
Conversation
GAMAURER
reviewed
Jul 14, 2026
| | Value | Description | | ||
| | --------------------------- | ------------------------------------------------------------------ | | ||
| | `SUBSCRIBER_ONLY` (default) | Reads and writes against the subscriber tenant. Requires `tenant`. | | ||
| | `PROVIDER_ONLY` | Reads and writes against the provider tenant. No `tenant` needed. | |
There was a problem hiding this comment.
I think it might be useful to note that there is no tenant isolation in this case, just to make the consequences of enabling provider very clear.
Member
Author
There was a problem hiding this comment.
Done. I've updated the documentation to make it clear.
- create_client() and AgentMemoryClient.__init__ accept access_strategy (default SUBSCRIBER_ONLY) and tenant as constructor params - _resolve_tenant is now an instance method; per-call params override instance defaults - All method signatures change to Optional[AccessStrategy] = None (sentinel: use instance default) - user-guide: add client-level configuration section and PROVIDER_ONLY isolation warning - tests: update TestAccessStrategy and TestCreateClient for instance method
cassiofariasmachado
force-pushed
the
feat/enable-multitenancy-support-for-agent-memory
branch
from
July 14, 2026 20:40
3282daf to
db9ba9b
Compare
15 tasks
… warning - SUBSCRIBER_ONLY → SUBSCRIBER, PROVIDER_ONLY → PROVIDER across all agent_memory source, tests, feature files, and user guide - Add logger.warning() when AccessStrategy.PROVIDER is used, making the no-isolation behaviour explicit at runtime
- Remove access_strategy/tenant per-call params from all 13 methods - Validate access_strategy/tenant at __init__ time (same as bindings branch) - Store self._tenant at init; pass tenant_subdomain=self._tenant to transport on every call (preserves identityzone token URL derivation internally) - Update tests: remove _resolve_tenant tests, add init-time validation tests, remove per-call kwargs from all call sites - Public API now identical to feat/enable-multitenancy-support-for-agent-memory-using-bindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds multitenancy support to the
agent_memorymodule.access_strategyandtenantare configured once atcreate_client()time — no per-call params on individual methods.Implementation (native multitenancy approach)
This branch uses a single default binding with token URL derivation: the subscriber token URL is derived by replacing the
identityzonesegment intoken_urlwith thetenantsubdomain (using theidentityzonefield from the UAA binding). This is the intended implementation once the Agent Memory service natively supports multitenancy.The companion PR #232 (
feat/enable-multitenancy-support-for-agent-memory-using-bindings) implements the same public API but uses per-tenant bindings as a temporary workaround for environments where native multitenancy is not yet available.Key changes
AccessStrategyenum (SUBSCRIBER/PROVIDER) oncreate_client()AgentMemoryClientsimplified: single_transport,access_strategyandtenantvalidated at construction,logger.warning()whenPROVIDERis used_http_transport.pyunchanged — per-tenant token derivation viaidentityzoneremainsRelated Issue
Closes #
Type of Change
How to Test
Checklist
uvx pre-commit run --all-files)Breaking Changes
create_client()with no args raisesAgentMemoryValidationError(defaultSUBSCRIBERrequirestenant). Individual methods no longer acceptaccess_strategyortenant.Migration: